package leetcode.shortestPalindrome;

public class ShortestPalindrome {
	
	public String shortestPalindrome(String s) {
		int j = 0;
		
		for (int i = s.length() - 1; i >= 0; i--) {
			if (s.charAt(j) == s.charAt(i)) {
				j++;
			}
			if (i <= j) {
				return s;
			}
		}
		
		return null;
	}
	
}
